import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:robot3/widgets.dart';

void main() {
  runApp(MaterialApp(home: const _SecondScreen()));
}

class _SecondScreen extends StatelessWidget {
  const _SecondScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Second Screen')),
      // body:Card01()
      body: RobotFixedSizeCard(
        width: 300,
        height: 300,
        child: Container(
          height: 100,
          width: 100,
          color: Colors.tealAccent[100],
        ),
      ),
    );
  }
}

class Card01 extends StatelessWidget {
  const Card01({super.key});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 200,
      height: 200,
      child: Card(
        // shape: RoundedRectangleBorder(
        //   borderRadius: BorderRadius.circular(16), // Full-screen effect
        // ),
        child: Padding(
          padding: const EdgeInsets.all(
            16.0, // 像素值直接使用 dp 转换
          ),
          child: Container(
            height: 10,
            width: 10,
            color: Colors.blueAccent[100],
          ),
        ),
      ),
    );
  }
}

class CardExample extends StatelessWidget {
  const CardExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Card(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            const ListTile(
              leading: Icon(Icons.album),
              title: Text('The Enchanted Nightingale'),
              subtitle: Text('Music by Julie Gable. Lyrics by Sidney Stein.'),
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                TextButton(
                  child: const Text('BUY TICKETS'),
                  onPressed: () {
                    /* ... */
                  },
                ),
                const SizedBox(width: 8),
                TextButton(
                  child: const Text('LISTEN'),
                  onPressed: () {
                    /* ... */
                  },
                ),
                const SizedBox(width: 8),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
